package com.foreknow.demo5;

import java.awt.*;
import java.awt.event.ActionListener;

public class TestWindow extends Frame {

public TestWindow(String title) {
    Button button = new Button("click me");
    ActionListener listener = new ActionListenerImpl();
    button.addActionListener(listener);
    this.add(button);
    //设置容器的大小
    this.setSize(400,400);
    //设置标题
    this.setTitle(title);
    //设置容器的可见性
    this.setVisible(true);
}
    public static void main(String[] args) {
        TestWindow testWindow = new TestWindow("windows");
//        testWindow.init("windows");
    }
}
